/* mainwindow.h -- MainWindow class declaration
 * mainwindow.h is part of Robodrome
 *
 * Copyright (c) 2009 Alex French
 * Robodrome is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Robodrome is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#pragma once
#include <libglademm/xml.h>
#include <gtkmm.h>
#include "arena.h"
#include "robot.h"
#include "battlebutton.h"
#include "hardware_options.h"
#include "debugger.h"
#include "world.h"

class MainWindow : public sigc::trackable
{
	public:
		explicit MainWindow(Glib::RefPtr<Gnome::Glade::Xml> refXml);
		~MainWindow(void);

		Gtk::Window&  get_window() const { return *window; }
		void on_menu_quit(void);
		void on_menu_arena(void);
		void on_menu_drafting_board(void);
		void on_menu_open(void);
		void on_menu_new(void);
		void on_menu_save(void);
		void on_menu_save_as(void);
		void on_hardware_options_button(void);
		void on_robot_button_toggled(void);
		void add_new_robot(void);
		void update_roster(void);
		void close_robot(void);
		void on_compile_button(void);
		void on_battle_button(void);
		void step_battle(void);
		void on_robot_name_button(void);
		void on_menu_play_sounds(void);
		void on_menu_speed(void);
		void on_menu_display_battle(void);
		void on_menu_debug(void);

	private:
		Gtk::Window *window;
		Gtk::Notebook *tabs;
		Arena *arena;
		Gtk::FileChooserDialog *file_open_dialog;
		Gtk::FileChooserDialog *file_save_dialog;
		Gtk::Label *robot_name[6];
		Gtk::Label *robot_status[6];
		Gtk::RadioButton *robot_button[6];
		Gtk::MenuItem *menu_open;
		Gtk::MenuItem *menu_new;
		Gtk::MenuItem *menu_save;
		Gtk::MenuItem *menu_save_as;
		Gtk::MenuItem *menu_close;
		Gtk::Button *hardware_options_button;
		HardwareOptions *hardware_options_dialog;
		Gtk::TextView *src_view;
		Glib::RefPtr<Gtk::TextBuffer> src_view_buf;
		Gtk::Button *compile_button;
		BattleButton *battle_button;
		Gtk::Button *robot_name_button;
		Gtk::Dialog *robot_name_dialog;
		Gtk::Entry *robot_name_entry;
		Gtk::CheckMenuItem *menu_play_sounds;
		Gtk::CheckMenuItem *menu_speed[5];
		int m_arena_speed;
		Gtk::CheckMenuItem *menu_display_battle;
		Gtk::RadioMenuItem *menu_debug[3];
};
